from Selenium2Library.keywords.keywordgroup import KeywordGroup
import pyvirtualdisplay, os

class _VirtualDisplayKeywords(KeywordGroup):
    def __init__(self):
        print '_VirtualDisplayKeywords.init'
        
    def start_headless_display(self):
        if os.environ.has_key('http_proxy'):
            del os.environ['http_proxy']
        self._vDisplay = pyvirtualdisplay.Display(visible=False, size=(1024,768))
        self._info(self._vDisplay.start())
        self._info("virtual display started")
    
    def stop_headless_display(self):
        self._info(self._vDisplay.stop())
        self._info("virtual display stopped")


	
